home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir26
/
epi601_2.zip
/
FILES07.EXE
/
ARTIFACT.PGM
< prev
next >
Wrap
Text File
|
1994-08-22
|
2KB
|
42 lines
*Program to generate data for the questionnaire ARTIFACT.REC
*Before running this program, you should erase any file called ARTIFACT.REC
* and create a new one in the ENTER program from the questionnaire ARTIFACT.QES
READ ARTIFACT
ECHO
ECHO Generating data. Please be patient and watch the upper right screen corner.
*Generate ID numbers to put in the new file using a cumulative variable
DEFINE ID #### CUMULATIVE
ID = ID + 1
IDNUMBER = ID
*A special feature of RECODE assigns M if the random number from 0 to 1 is
* between 0 and .70, F if from .71 to .95 and unknown if .96 to 1.00.
RECODE RND TO SEX 70% = M 25%=F ELSE = .
*Assign a random integer from 0 to 65 to AGE
AGE = RAN (65)
*Modify this so that there is a 65% chance of having an age from 20 to 30
IF RND(1) > 0.45 THEN AGE = RAN(10) + 20
*Make the reporting period start on a particular date
REPORTDATE = "01/01/89"
*Allow it to continue for 400 days
REPORTDATE = REPORTDATE + RAN 400
*Make 60% of answers Y; 37% N, and the rest unknown.
RECODE RND TO OPPORTUNIS 60% = Y 37% = N ELSE = .
*Set up the two remaining variables
RECODE RND TO KAPOSISARC 55%=y 45%=N ELSE = .
RECODE RND TO HIV1 80%=y 27%=N ELSE=.
*Now create 100 such records.
GENERATE 100
*Check the frequencies to see the results
?Press any key to see the .REC file...?
READ ARTIFACT.REC
TYPE ARTIFACT.REC
ECHO End of Results; Use PgUp to examine more closely.
?Press any key to see a frequency of KAPOSISARC ?
ECHO The expected rate is 55% Y and 45% N
SET IGNORE = OFF
FREQ KAPOSISARC
?Press any key for a graph of AGE ...?
LINE AGE
?Press <F10> to leave ANALYSIS, or any other key to remain in ANALYSIS ?